<template>
  <div class="mui-content">
    <div class="mui-pages">
      <header class="mui-bar mui-bar-nav">
        <div class="header-common-title flex-justify-start">
          <div class="mui-action-back">
            <img @click="fn.back()" class="back-btn" src="../../../../static/images/back.png"></div>
          <div class="header-search flex-center">党员学习补开申请</div>
        </div>
      </header>
      <div class="mui-page-content">
        <div class="mui-scroll-wrapper">
          <div class="mui-scroll work-message-lists">
            <template v-for="item in list">
              <p class="history-message flex-center">{{fn.formateYearSecond(item.CREATE_TIME_)}}</p>
              <div class="work-message-item">
                <div class="work-message-item-title">
                  <h5>{{item.PARTY_GORUP_NAME_}}集体学习补开申请</h5>
                </div>
                <div class="flex-between-center message-details" @click="detail(item)">
                  <p>查看详情</p>
                  <span class="mui-icon mui-icon-arrowright"></span>
                </div>
              </div>
            </template>

            <noData v-if="!isLoading && list.length==0"></noData>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
  import tools from '@/utils/tools'
  import loginService from '@/service/loginService'
  export default {
    name: '',
    data () {
      return {
        fn: tools,
        countData: {
          dwbPactchUpApprovaCount: 0
        }, // 数量
        list: [],
        isLoading: false,
        type: 'approve' // approve:审批申请，approveHistory:审批记录
      }
    },
    created () {
      this.type = this.$route.params.type || 'approve'
      this.loadData()
    },
    methods: {
      jump (type) {
        this.$router.replace({path: '/approve/' + type})
      },
      detail (item) {
        this.$store.state['patchDetails' + item.ID_] = item
        this.$router.push({path: '/patchDetails/' + item.ID_})
      },
      loadData () {
        let data = {
          pageSize: 1000,
          pageIndex: 0
        }
        this.isLoading = true
        loginService.dwbPactchUpApprovalList(data).then(res => {
          this.isLoading = false
          if (res.code !== 200) {
            return tools.tip(res.message)
          }
          this.list = res.data
        })
      }
    },
    watch: {
      $route (to, from) {
        this.type = to.params.type
      }
    }
  }
</script>

<style scoped lang="">

</style>
